/*package com.ncs.base.task.config;

import java.util.Date;

import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.TriggerBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import com.ncs.base.task.service.UserMasterService;
import com.ncs.base.task.service.UserSalveService;
*//**
 * 初始化一个测试Demo任务
 * 创建者 爪哇笔记
 * 创建时间	2018年4月3日
 *//*
@Component
public class TaskRunner implements ApplicationRunner{
    
	private final static Logger LOGGER = LoggerFactory.getLogger(TaskRunner.class);
	
	@Autowired
	private UserMasterService userMasterService;
	
	@Autowired
	private UserSalveService userSalveService;
	
	@Autowired @Qualifier("Scheduler")
    private Scheduler scheduler;
	
    @Override
    public void run(ApplicationArguments var) throws Exception{
        *//**
         * 系统启动的时候会初始化一个任务
         *//*
    	String table = null;
		String flag = "1";
		if("1".equals(flag)) {
			table ="user";
		}else {
			table = "user_01";
		}
   	        Class cls = Class.forName("com.ncs.base.task.job.ChickenJob") ;
   	        cls.newInstance();
   	        //构建job信息
   	       JobDetail job = JobBuilder.newJob(cls)
                 .usingJobData("jobDetail1", "这个Job用来测试的")
                 .usingJobData("tableName", table)
                 .withIdentity("job1", "group1").build();
            job.getJobDataMap().put("jobMethodName", "test1");
            // 触发时间点
            // 3、构建Trigger实例,每隔1s执行一次
            Date startDate = new Date();
            startDate.setTime(startDate.getTime() + 5000);

            Date endDate = new Date();
            endDate.setTime(startDate.getTime() + 5000);
            CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity("trigger1", "triggerGroup1")
                    .usingJobData("trigger1", "这是jobDetail1的trigger")
                    .usingJobData("tableName", table)
                    .startNow()//立即生效
                    .startAt(startDate)
                    .endAt(endDate)
                    .
                    .build();
   	       //4、执行
   	        scheduler.scheduleJob(job, cronTrigger);
   	        System.out.println("--------scheduler start ! ------------");
   	        scheduler.start();
   	        System.out.println("--------scheduler shutdown ! ------------");
    }

}*/